import request from '@/utils/request'

export function getCinemaList(params: { cityId: number; ticketFlag: number }) {
  return request.get<{
    cinemas: ICinema[]
  }>('mall.film-ticket.cinema.list', params)
}

/**
 * 获取影院详情
 */
export function getCinemaInfo(cinemaId: number) {
  return request.get<{
    cinema: ICinema
  }>('mall.film-ticket.cinema.info', { cinemaId })
}

/**
 * 获取影院的电影列表数据
 */
export function getCinemaFilmList(cinemaId: number) {
  return request.get<{
    films: IFilm[]
  }>('mall.film-ticket.film.cinema-show-film', { cinemaId })
}

/**
 * 获取影院的电影的排期列表
 */
export function getScheduleList(cinemaId: number, filmId: number, date: number) {
  return request.get<{
    schedules: ISchedule[]
  }>('mall.film-ticket.schedule.list', { cinemaId, filmId, date })
}
